package de.tum.wi.som.rcpsp.entities;

import java.util.List;
import java.util.ArrayList;

/**
 * This entity provides conditions for the resource usage that have to be 
 * considered by the Entity Resource Assignment.   
 *
 */
public class WorkContentResource {

	/**
	 * minBlockLength denotes a minimal period for a constant usage of the work-content resource.
	 */
	private int minBlockLength;
	private int limit;
	private List<ResourceAssignment> resourceAssignments= new ArrayList<ResourceAssignment>();

	public WorkContentResource(int minBlockLength, int limit) {
		super();
		this.minBlockLength = minBlockLength;
		this.limit=limit;
	}
	
	public int getMinBlockLength() {
		return minBlockLength;
	}

	public void setMinBlockLength(int minBlockLength) {
		this.minBlockLength = minBlockLength;
	}
	public int getLimit() {
		return limit;
	}

	public void setLimit(int limit) {
		this.limit = limit;
	}

	public boolean addResourceAssignment(ResourceAssignment resourceAssignment){
		return resourceAssignments.add(resourceAssignment);
	}
	public boolean removeResourceAssignment(ResourceAssignment resourceAssignment){
		return resourceAssignments.remove(resourceAssignment);
	}

}
